#define backend_paginate(currentPage,totalPage,actionUrl,urlParas)
	#if (totalPage <= 0) || (currentPage > totalPage))
		#return
	#end
	#setLocal(startPage = currentPage - 4)
	#if (startPage < 1)
		#setLocal(startPage=1)
	#end


	#setLocal(endPage = currentPage + 4)
	#if (endPage > totalPage)
		#setLocal(endPage = totalPage)
	#end
	
	<div class="pagination">
			#if (currentPage <= 8)
				#setLocal(startPage=1)
			#end
			#if ((totalPage - currentPage) < 8)
				#setLocal(endPage=totalPage)
			#end
			#if (currentPage == 1)
				<span class="disabled prev_page">上页</span>
			#else
				<a href="#(actionUrl)#(currentPage - 1)#(urlParas??)" class="prev_page">上页</a>
			#end
			
			#if (currentPage > 8)>
				<a href="#(actionUrl)#(1)#(urlParas??)">#(1)</a>
				<a href="#(actionUrl)#(2)#(urlParas??)">#(2)</a>
				<span class="gap">…</span>
			#end
			
			#for(i=startPage;i <= endPage;i++)
				#if (currentPage == i)
					<span class="current">#(i)</span>
				#else
					<a href="#(actionUrl)#(i)#(urlParas??)">#(i)</a>
				#end
			#end
			
			#if ((totalPage - currentPage) >= 8)
				<span class="gap">…</span>
				<a href="#(actionUrl)#(totalPage - 1)#(urlParas??)">#(totalPage - 1)</a>
				<a href="#(actionUrl)#(totalPage)#(urlParas??)">#(totalPage)</a>
			#end
			
			#if (currentPage == totalPage)
				<span class="disabled next_page">下页</span>
			#else
				<a href="#(actionUrl)#(currentPage + 1)#(urlParas??)" class="next_page" rel="next">下页</a>
			#end
	</div>
#end